package alisms;

import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;

import com.alipay.api.domain.Matcher;
import com.vdurmont.emoji.EmojiParser;

public class EmojiFilter {
	public String filterEmoji(String source) {  
        if(source != null)
        {
        	//🐵//
            Pattern emoji = Pattern.compile ("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",Pattern.UNICODE_CASE | Pattern . CASE_INSENSITIVE ) ;
            java.util.regex.Matcher emojiMatcher = emoji.matcher(source);
            if ( emojiMatcher.find()) 
            {
                source = emojiMatcher.replaceAll("□");
                return source ; 
            }
        return source;
       }
       return source;  
    }
}